package com.ydgk.servlet;

import com.ydgk.dao.AdminDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "AdminFindByIdServlet", urlPatterns = "/AdminFindByIdServlet.action")
public class AdminFindByIdServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setAttribute("admin",new AdminDao().findById(Integer.parseInt(request.getParameter("aid"))));
        request.getRequestDispatcher("admininformation.jsp").forward(request,response);
    }


}
